#include "hashablestring.h"
#include "config.h"
#include "stdio.h"

HashableString::HashableString(const char* str)
    : m_str(str)
{
}

unsigned long HashableString::hashCode(unsigned int seed) const
{
    const char *key = m_str.c_str();
    int length = m_str.size();
    unsigned long hash = 5381;  
    while (length--) 
    {
        hash = ((hash*seed << 5) + hash*seed) + (unsigned int)*key++;  
    }

    hash %= TABLE_SIZE;
    return hash;
}

